<script setup lang="ts">
import type { BreadcrumbItem } from '@/types/common'
import { useI18n } from 'vue-i18n'

defineProps<{ items: BreadcrumbItem[] }>()

const { t } = useI18n()
</script>

<template>
  <div class="breadcrumbs text-sm">
    <ul>
      <li v-for="(item, index) in items" :key="index">
        <router-link v-if="item.to" :to="item.to">
          {{ t(item.label) }}
        </router-link>
        <template v-else>{{ t(item.label) }}</template>
      </li>
    </ul>
  </div>
</template>
